<<<template "index/public/header.tpl" .>>>
<div class="layui-container container">

    <div class="layui-row layui-col-space20">
        <div class="layui-col-md8">
            <div>
              <span class="layui-breadcrumb">
          <a href="index.html">首页</a>
          <a><cite><<<.cat_name>>></cite></a>
        </span>
                <hr class="layui-bg-red">
                <<<range $index, $elem := .article_list>>>
                <div class="article-list">
                    <figure><img lay-src="<<<$elem.ImageUrl>>>"></figure>
                    <ul>
                        <h3>
                            <a target="_blank" href="/article_detail?article_id=<<<$elem.Id>>>"><<<$elem.Title>>></a>
                        </h3>
                        <p><<<$elem.Introduction>>></p>
                        <p class="autor">
                            <span class="lm f_l"><a href="#"><<<$elem.CatName>>></a></span>
                            <span class="dtime f_l"><<<$elem.AddTime>>></span>
                            <span class=" f_r"><i class="layui-icon">&#xe612;</i><<<$elem.Author>>></span>
                            <span class=" f_r"><i class="layui-icon">&#xe60b;</i><<<$elem.TagsName>>></span></p>
                    </ul>
                </div>
                <<<end>>>
            </div>
            <!--分页-->
            <div id="page"></div>
        </div>
        <<<template "index/public/right.tpl" .>>>
    </div>
</div>
<<<template "index/public/footer.tpl" .>>>
<script>
    //分页模块
    layui.use(['laypage', 'layer'], function() {
        var laypage = layui.laypage
            , layer = layui.layer;
        //只显示上一页、下一页

        var count = "<<<.count>>>";
        var page = "<<<.page>>>";
        var page_size = "<<<.page_size>>>";
        laypage.render({
            elem: 'page'
            ,count: count
            ,limit:page_size
            //['count', 'prev', 'page', 'next', 'limit', 'skip']
            ,layout: ['count','prev', 'page', 'next']
            ,curr:page
            ,jump: function(obj, first){
                if(!first){
                    window.location.href="/article?cat_id=<<<.cat_id>>>&page="+obj.curr+"&page_size="+obj.limit
                }
            }
        });
    });
</script>
</body>
</html>
